var xmlhttp

/************************************** FOR VALIDATING USERNAME START ********************/

function validateUsername(username)
	{
		xmlhttp=GetXmlHttpObject();
		if (xmlhttp==null)
  		{
  			alert ("Your browser does not support AJAX!");
  			return;
  		}
		var url="../include/ajax_files/validate_username.php";
		url=url+"?username="+username;
		url=url+"&sid="+Math.random();
		xmlhttp.onreadystatechange=stateChanged_username;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}	

function stateChanged_username()
	{
		if (xmlhttp.readyState==4)
  		{
  			document.getElementById("username").innerHTML=xmlhttp.responseText;
  		}
	}
/************************************** FOR VALIDATING USERNAME END ********************/

/************************************** FOR VALIDATING EMAIL START ********************/

function validateEmail(email)
	{
		xmlhttp=GetXmlHttpObject();
		if (xmlhttp==null)
  		{
  			alert ("Your browser does not support AJAX!");
  			return;
  		}
		var url="../include/ajax_files/validate_email.php";
		url=url+"?email="+email;
		url=url+"&sid="+Math.random();
		xmlhttp.onreadystatechange=stateChanged_email;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}	

function stateChanged_email()
	{
		if (xmlhttp.readyState==4)
  		{
  			document.getElementById("email").innerHTML=xmlhttp.responseText;
  		}
	}


/************************************** FOR VALIDATING EMAIL END ********************/



/************************************** FOR VALIDATING DESCRIPTION START ********************/

function validateDescription(description)
	{
		xmlhttp=GetXmlHttpObject();
		if (xmlhttp==null)
  		{
  			alert ("Your browser does not support AJAX!");
  			return;
  		}
		var url="../include/ajax_files/validate_description.php";
		url=url+"?description="+description;
		url=url+"&sid="+Math.random();
		//alert(url);
		xmlhttp.onreadystatechange=stateChanged_description;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}	

function stateChanged_description()// chk this out
	{
		if (xmlhttp.readyState==4)
  		{   //str="hello"
  			document.getElementById("description").innerHTML=xmlhttp.responseText;
  		}
	}


/************************************** FOR VALIDATING DESCRIPTION END ********************/


/************************************** FOR VALIDATING DETAILS START ********************/

function validateDetails(details)
	{
		xmlhttp=GetXmlHttpObject();
		if (xmlhttp==null)
  		{
  			alert ("Your browser does not support AJAX!");
  			return;
  		}
		var url="../include/ajax_files/validate_details.php";
		url=url+"?details="+details;
		url=url+"&sid="+Math.random();
		alert(url);
		xmlhttp.onreadystatechange=stateChanged_description;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}	

function stateChanged_description()// chk this out
	{
		if (xmlhttp.readyState==4)
  		{   //str="hello"
  			document.getElementById("details").innerHTML=xmlhttp.responseText;
  		}
	}


/************************************** FOR VALIDATING DETAILS END ********************/


/************************************** FOR VALIDATING CONTACT START ********************/

function validateContact(contact)
	{
		xmlhttp=GetXmlHttpObject();
		if (xmlhttp==null)
  		{
  			alert ("Your browser does not support AJAX!");
  			return;
  		}
		var url="../include/ajax_files/validate_contact.php";
		url=url+"?contact="+contact;
		url=url+"&sid="+Math.random();
		alert(url);
		xmlhttp.onreadystatechange=stateChanged_contact;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}	

function stateChanged_contact()// chk this out
	{
		if (xmlhttp.readyState==4)
  		{   //str="hello"
  			document.getElementById("contact").innerHTML=xmlhttp.responseText;
  		}
	}


/************************************** FOR VALIDATING CONTACT END ********************/







function GetXmlHttpObject()
	{
		if (window.XMLHttpRequest)
  		{
  			// code for IE7+, Firefox, Chrome, Opera, Safari
  			return new XMLHttpRequest();
  		}
		if (window.ActiveXObject)
  		{
  			// code for IE6, IE5
  			return new ActiveXObject("Microsoft.XMLHTTP");
  		}
		return null;
	}